import requests from "./requests"
import mockRequest from "./mockRequests"
export const reqCategoryList = () => requests({ url: "/product/getBaseCategoryList", method: "GET" })
export const reqGetBannerList = () => mockRequest.get("/banner");
export const reqGetFloorList = () => mockRequest.get("/floor")
export const reqGetSearchInfo = (params) => requests({ url: "/list", method: "post", data: params })
export const reqGetGoodsInfo = (skuId) => requests.get(`/item/${skuId}`)
export const reqAddOrUpdateShopCart = (skuId, sumNum) => requests.post(`/cart/addToCart/${skuId}/${sumNum}`)
export const reqCartList = () => requests.get("/cart/cartList");
export const reqDeleteCartListById = (skuId) => requests.delete(`/cart/deleteCart/${skuId}`)
export const reqChangeCheckedById = (skuId, isChecked) => requests({ url: `/cart/checkCart/${skuId}/${isChecked}`, method: "get" })
export const reqGetCode = (phone) => requests({ url: `/user/passport/sendCode/${phone}`, data: phone, method: "get" })
export const reqRegisterUser = (data) => requests({ url: "/user/passport/register", method: "post", data })
export const reqLoginUser = (data) => requests({ url: "/user/passport/login", method: "post", data })
export const reqGetUserInfo = () => requests({ url: "/user/passport/auth/getUserInfo", method: "GET" })
export const reqLogout = () => requests.get("/user/passport/logout")
// export const reqGetAddressInfo = () => requests.get("/user/userAddress/auth/findUserAddressList")
export const reqGetOrderInfo = () => requests.get("/order/auth/trade")
export const reqGetAddressInfo = () => mockRequest.get("/address")
//提交订单 /api/order/auth/submitOrder?tradeNo={tradeNo}  post
export const reqSubmitOrder = (tradeNo, data) => requests({ url: `/order/auth/submitOrder?tradeNo=${tradeNo}`, method: "POST", data })
//获取订单支付信息  /api/payment/weixin/createNative/{orderId}   get
export const reqGetOrderInfoByOrderId = (orderId) => requests({ url: `/payment/weixin/createNative/${orderId}`, method: "GET" })
//查询支付订单状态  /api/payment/weixin/queryPayStatus/{orderId}    get
export const reqGetOrderStatus = (orderId) => requests({ url: `/payment/weixin/queryPayStatus/${orderId}`, method: "get" })
//获取订单列表  /api/order/auth/{page}/{limit}  get
export const reqGetOrderList = (page, limit) => requests.get(`/order/auth/${page}/${limit}`)